package com.wang.utils;

import lombok.*;

/**
 * @Classname ResponseUtil
 * @Description TODO
 * @Date 2024/8/29 9:07
 * @Created by pc
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class ResponseUtil {
    // 请求状态码
    private Integer code;

    // 消息提示
    private String msg;
    // 需要携带的数据
    private Object data;

    /**
     * @param
     * @return  带数据的返回
     * @description
     * @author admin
     * @updateTime 2024/8/29 9:14
     */
    public static ResponseUtil get(ResponseEnum responseEnum,Object object){
        return new ResponseUtil(responseEnum.getCode(), responseEnum.getMsg(), object);
    }

    /**
     * @param
     * @return   不带数据的返回
     * @description
     * @author admin
     * @updateTime 2024/8/29 9:14
     */

    public static ResponseUtil get(ResponseEnum responseEnum){
        return  new ResponseUtil(responseEnum.getCode(), responseEnum.getMsg(),null);
    }




}
